package com.server.http.handler.impl;

import com.server.conditionenum.HttpReturnStatus;
import com.server.db.DataBaseManager;
import com.server.http.handler.HttpHandler;
import com.server.http.request.HttpRequestMessage;
import com.server.http.response.HttpResponseMessage;
import com.server.mine.net.HttpProtocol;

public class UseRedeem extends HttpHandler{
	@Override
	public void handle(HttpRequestMessage request, HttpResponseMessage response) {
		String redeem = request.getParameter("redeem");
		if(redeem != null && redeem.length() > 10) {
			DataBaseManager.GetInstance().UseRedeemCode(redeem);
		}
		SetReturnData(response,1,HttpProtocol.USEREDEEMCODE,HttpReturnStatus.Successed);
	}
}